package com.dj.dal;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.dj.domain.entity.JobsCvOrder;

/**
 * 类CvOrderDao.java的实现描述：TODO 类实现描述
 * 
 * @author jasen.hsu.cn@gmail.com 2012-4-19 下午12:53:24
 */
public class CvOrderDao extends BaseDao<JobsCvOrder> {

    public CvOrderDao(){
        this.namespace = "jobs.single.jobsCvOrder";
    }

    @SuppressWarnings("unchecked")
    public List<JobsCvOrder> listByCvuid(Long cvuid) {
        return (List<JobsCvOrder>) sqlMapClientTemplate.queryForList(namespace + "." + "listByCvuid", cvuid);
    }

    @SuppressWarnings("unchecked")
    public List<JobsCvOrder> listByBuid(Long buid) {
        return (List<JobsCvOrder>) sqlMapClientTemplate.queryForList(namespace + "." + "listByBuid", buid);
    }

    public JobsCvOrder loadByBuidAndCvid(Long buid, Long cvid) {
        Map<String, Long> map = new HashMap<String, Long>();
        map.put("buid", buid);
        map.put("cvid", cvid);
        return (JobsCvOrder) sqlMapClientTemplate.queryForObject(namespace + "." + "loadByBuidAndCvid", map);
    }

    public JobsCvOrder loadByBuidAndCvuid(Long buid, Long cvuid) {
        Map<String, Long> map = new HashMap<String, Long>();
        map.put("buid", buid);
        map.put("cvuid", cvuid);
        return (JobsCvOrder) sqlMapClientTemplate.queryForObject(namespace + "." + "loadByBuidAndCvuid", map);
    }

}
